
<!DOCTYPE html>
<html>

	<head>
		<meta http-equiv="Pragma" CONTENT="no-cache">
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<meta name="renderer" content="webkit">

		<%include("/common/include.html"){}%>
	</head>

	<body >
			<div class="easyui-layout" data-options="fit:true">
				<div data-options="region:'center'" style="padding:10px;">
				<form id="intoShop_form">
					<h2 style="font: 36px '微软雅黑';text-align: center;">〖瘦吧〗顾客减肥转店通知单</h2>
					<div style="margin: 0 auto;width: 650px;padding: 10px;">
						<ul>
								<li style="margin-top: 10px;">
									<input id="bsCusIds" type="hidden"  name="customerIds" value="${customer.ids !}">
									<input id="btoshopTime" type="hidden"  name="" value='${btoshop.outTime !,dateFormat="yyyy-MM-dd"}'>
									<span style="margin-left: 23px;">姓名</span>
									<input type="text"  style="border-bottom: 1px solid black;width: 80px;text-align:center;" readonly="readonly" value="${customer.name !}"/>
									<span style="margin-left: 40px;">年龄</span>
									<input type="text" style="border-bottom: 1px solid black;width: 80px;text-align:center;" readonly="readonly" value="${customer.age !}"/>
									<span style="margin-left: 62px;">身高</span>
									<input type="text" style="border-bottom: 1px solid black;width: 80px;text-align:center;" readonly="readonly" value="${customer.customerDetail.height !}"/>cm
									<span style="margin-left: 40px;">电话</span>
									<input type="text" style="border-bottom: 1px solid black;width: 80px;text-align:center;" readonly="readonly" value="${customer.phone !}"/>
								</li>
								<li style="margin-top: 10px;">
									<span >标准体重</span>
									<input type="text" style="border-bottom: 1px solid black;width: 60px;text-align:center;" readonly="readonly" value="${customer.customerAgreement.std_weight !}"/>斤
									<span style="margin-left: 23px;">减肥前</span>
									<input type="text" style="border-bottom: 1px solid black;width: 60px;text-align:center;" readonly="readonly" value="${customer.customerAgreement.before_weight !}"/>斤
									<span style="margin-left:38px;">减肥后</span>
									<input type="text" style="border-bottom: 1px solid black;width: 60px;text-align:center;" readonly="readonly" value="${customer.customerAgreement.after_weight !}"/>斤
									<span style="margin-left: 22px;">合计疗程</span>
									<input type="text" style="border-bottom: 1px solid black;width: 60px;text-align:center;" readonly="readonly" value="${customer.customerAgreement.treatment !}"/>
								</li>
								<li style="margin-top: 10px;">
									<span style="margin-left: -24px;">首次减肥日期</span>
									<input type="text" style="border-bottom: 1px solid black;width: 80px;text-align:center;" readonly="readonly" value="${btoshop.firstLoseWeightTime !} "/>
									<span style="margin-left: 16px;">末次减肥日期</span>
									<input type="text" style="border-bottom: 1px solid black;width: 80px;text-align:center;" readonly="readonly" value="${btoshop.lastLoseWeightTime !}"/>
									<span style="margin-left: 20px;">最后体重</span>
									<input type="text" style="border-bottom: 1px solid black;width: 60px;text-align:center;" readonly="readonly" value="${btoshop.lastWeight !}"/>斤
									<span style="margin-left: 22px;">减肥次数</span>
									<input type="text" style="border-bottom: 1px solid black;width: 60px;text-align:center;" readonly="readonly" value="${btoshop.delWeightNum !}"/>
								</li>
								<li style="margin-top: 10px;">
									<span>协议编号</span>
									<input type="text" style="border-bottom: 1px solid black;width:150px;text-align:center;" readonly="readonly" value="${btoshop.oldAgreementNumber !}"/>
								</li>
							</ul>
						<p style="height: 10px;"></p>
						<table id="cuspro_datagrid" class="easyui-datagrid" style="width:100%;height:auto"></table>
						<ul>
							<li style="height: 40px;width: 100%;line-height: 40px;">
								<span>减至：</span>
								<input type="text" style="width: 90px;border-bottom: 1px solid black;text-align:center;" readonly="readonly" value="${customer.customerDetail.nowWeight !}"/>斤
								<span style="margin-left: 100px;">截至：</span>
								<input type="text" style="width: 90px;border-bottom: 1px solid black;text-align:center;"/>年
								<input type="text" style="width: 90px;border-bottom: 1px solid black;text-align:center;"/>月底
							</li>
							<li style="height: 40px;width: 100%;line-height: 40px;">
								<span>转出门店</span>
								<input id="outorganIds" type="hidden" name = "outorganIds"  value="${organization.ids !}">
								<input class="easyui-textbox theme-textbox-radius" style="width:100px;height:30px" readonly="readonly" value="${organization.name !}">
								<span style="margin-left: 70px;">转入门店</span>
								<input class="easyui-textbox theme-textbox-radius" style="width:100px;height:30px" readonly="readonly" value="${intoorganization.name !}">
								<span style="margin-left: 70px;">转店原因</span>
								<input class="easyui-textbox theme-textbox-radius" style="width:100px;height:30px" readonly="readonly" value="${reason !}">
							</li>
							<li style="height: 40px;width: 100%;line-height: 40px;">
								<span>店长签字：</span>
								<input type="text" style="border-bottom: 1px solid black;width: 80px;text-align:center;" readonly="readonly" value="${customer.organization.agent.name !}"/>
								<span style="margin-left: 75px;">店员签字：</span>
								<input type="text" style="border-bottom: 1px solid black;width: 80px;text-align:center;" readonly="readonly" value="${customer.customerDetail.fzUser.name !}"/>
								<span style="margin-left: 75px;">顾客签字：</span>
								<input type="text" style="border-bottom: 1px solid black;width: 80px;text-align:center;" readonly="readonly" value="${customer.name !}"/>
							</li>
							<li style="height: 50px;width: 100%;font-weight: bold;line-height: 20px;">
								注：为了让您达到最好的减肥效果，请于
								<input type="text" style="border-bottom: 1px solid black;width: 80px;"/>月
								<input type="text" style="border-bottom: 1px solid black;width: 80px;"/>日
								到店办理服务手续，逾期此单失效需重新办理。谢谢！
							</li>
<!-- 							<li style="height: 50px;width: 100%;line-height: 50px;text-align: center;"> -->
<!-- 								<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-ok'">确认转入</a> -->
<!-- 							</li> -->
						</ul>
						<div >
							
						</div>
						<div id="allData" style="display:none;"></div>
					</div>
					</form>
				</div>
			</div>
			<script type="text/javascript">
			$(document).ready(function () {
				
				loadtable();
			})			
			function loadtable()
			{	 
				var	customerIds=$('#bsCusIds').val();
				var btoshopTime=$('#btoshopTime').val();
				var outorganIds=$('#outorganIds').val();
				var columns = [[

								{field:'productids',title:'产品ids',hidden:true},
								{field:'proname',title:'产品名称',width:100,align:'center'},
								{field:'count',title:'产品剩余数量',width:100,align:'center'},
								{field:'totalexperience',title:'产品剩余使用数量',width:100,align:'center'},
								{field:'proprice',title:'购买时单价',width:100,align:'center'},
								{field:'totalprice',title:'购买时总价',width:100,align:'center'},
								{field:'jzjg',title:'结转价格',width:100,align:'center'}
						    ]];
				$('#cuspro_datagrid').datagrid({
					
					 cls: "theme-datagrid",
					 fitColumns:true,
					singleSelect: true,
					rownumbers: true, //显示序号
					columns: columns,
					queryParams: {
						customerIds: customerIds,
						btoshopTime: btoshopTime,
						outorganIds: outorganIds
					},
					url:"${cxt !}/bintoShop/getCusPro"
				});
			}
// 			

			
			</script>
			<script type="text/javascript">
			 //@ sourceURL=aaaaaaaaaa
			var submitForm = function($dialog, $grid, $tree, $pjq) {
				 var rows=$('#cuspro_datagrid').datagrid('getRows');
				if(rows.length>0)
				{
					
					for(var i=0;i<rows.length;i++)
					{	
						var proids = rows[i].productids;
						
						var proname = rows[i].proname;
						var pronum = rows[i].count;
						var totalexperience = rows[i].totalexperience;
						//var proprice = rows[i].proprice;
						//var totalprice = rows[i].totalprice;
						var jzjg = rows[i].jzjg;
						if(jzjg!=0){
							$("#allData").append("<input type='hidden' name='productSalesList["+i+"].price' value='"+jzjg+"'/>");
							//$("#allData").append("<input type='hidden' name='productSalesList["+i+"].customerIds' value='"+customerids+"'/>");
							$("#allData").append("<input type='hidden' name='productSalesList["+i+"].productID' value='"+proids+"'/>");
							$("#allData").append("<input type='hidden' name='productSalesList["+i+"].number' value='"+pronum+"'/>");
							//$("#allData").append("<input type='hidden' name='customerProductSurplusList["+i+"].proprice' value='"+proprice+"'/>");
							//$("#allData").append("<input type='hidden' name='customerProductSurplusList["+i+"].totalprice' value='"+totalprice+"'/>");
							//$("#allData").append("<input type='hidden' name='customerProductSurplusList["+i+"].totalexperience' value='"+totalexperience+"'/>");
						}
						}
					} 
				if($grid!=null)
				{
					var $form = $("#intoShop_form");
					$.post('${cxt! }/bintoShop/saveIntoShop', sy.serializeObject($form),function(result) {
						if(result.code == "200"){
							 $grid.datagrid('reload');
							 $.slideMsg("保存成功", parent.$);
							 $dialog.dialog('destroy');
						}else{
						 $.slideMsg(result.msg, parent.$);
						}
					}, "json");
				}else
				{
					$dialog.dialog('destroy');
				} 
			};
// 				var submitForm = function($dialog, $grid, $tree, $pjq) {
// // 					var $grid=$('#intoShop_datagrid');
// 					var $form = $('#intoShop_form');
					
// 					var url = "${cxt! }/bintoShop/saveIntoShop";
// 					$.post(url, sy.serializeObject($form), function(result) 
// 					{
// 						if(result.msg==200){
// 							 $.slideMsg("保存成功", parent.$);
// 						}else{
// 							 $.slideMsg("保存失败", parent.$);
// 						}
// 					}
// 				};
			</script>
		</body>
</html>